if object_id (N'dbo.sp_check_authentication', N'P') IS NOT NULL
    drop procedure dbo.sp_check_authentication;
go

-- procedura za proverka na login parametri

create procedure [dbo].[sp_check_authentication] 
(
	@username varchar(30),
	@password varchar(30), 
	@result int output
) as
begin
	if exists(select 1 from Person where (username = @username) and (password = @password))
		set @result = 1
	else 
		set @result = 0	
end		
go

